home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xarchie-2.0.9 / m-file.c < prev    next >
C/C++ Source or Header  |  1995-06-18  |  1KB  |  68 lines

  1. /*
  2.  * m-file.c : File menu routines
  3.  *
  4.  * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  5.  */
  6.  
  7. #include <X11/Intrinsic.h>
  8. #include <X11/Xaw/SimpleMenu.h>
  9. #include <X11/Xaw/SmeBSB.h>
  10. #include <X11/StringDefs.h>
  11. #include "xarchie.h"
  12. #include "menu.h"
  13.  
  14. /*
  15.  * Functions defined here:
  16.  */
  17. void initFileMenu();
  18. static void fileMenuCallback();
  19.  
  20. /*
  21.  * Data defined here:
  22.  */
  23. static Widget fileMenu;
  24.  
  25. /*    -    -    -    -    -    -    -    -    */
  26.  
  27. void
  28. initFileMenu()
  29. {
  30.     fileMenu = createMenu("fileMenu","fileMenuItem",7,NULL,
  31.               fileMenuCallback);
  32. }
  33.  
  34. /* Callback procedure */
  35.  
  36. /*ARGSUSED*/
  37. static void
  38. fileMenuCallback(w,client_data,call_data)
  39. Widget w;
  40. XtPointer client_data;    /* item */
  41. XtPointer call_data;    /* ignored */
  42. {
  43.     int item = (int)client_data;
  44.  
  45.     switch (item) {
  46.     case 0: /* About */
  47.         XtCallActionProc(toplevel,"about",NULL,NULL,0);
  48.         break;
  49.     case 1: /* Open */
  50.         XtCallActionProc(toplevel,"browser-open-all",NULL,NULL,0);
  51.         break;
  52.     case 2: /* Get */
  53.         XtCallActionProc(toplevel,"ftp-get",NULL,NULL,0);
  54.         break;
  55.     case 3: /* Save */ 
  56.         XtCallActionProc(toplevel,"file-save",NULL,NULL,0);
  57.         break;
  58.     case 4: /* Load */ 
  59.         XtCallActionProc(toplevel,"file-load",NULL,NULL,0);
  60.         break;
  61.     case 5: /* Write */ 
  62.         XtCallActionProc(toplevel,"file-write",NULL,NULL,0);
  63.         break;
  64.     case 6: /* Quit */
  65.         XtCallActionProc(toplevel,"quit",NULL,NULL,0);
  66.     }
  67. }
  68.